//
//  Province.m
//  CarHomeTest
//
//  Created by lanou3g on 15-4-24.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//

#import "Province.h"


@implementation Province

- (instancetype)init
{
    self = [super init];
    if (self) {
        _citys = [[NSMutableArray alloc] initWithCapacity:0];//在这里，要用它来初始化数组，使数组存在的时间长久些
    }
    return self;
}




- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    if ([key isEqualToString:@"id"]) {
        self.ID = value;
    }
}


- (void)setCitys:(NSMutableArray *)citys {

    for (NSMutableDictionary *item in citys) {
        City *city = [City new];
        [city setValuesForKeysWithDictionary:item];
        
        [_citys addObject:city];
        
    }
}

//- (NSString *)description {
//    return [NSString stringWithFormat:@"%@, %@", self.name, self.citys];
//}



-(void)dealloc
{
    [_ID release];
    [_name release];
    [_firstletter release];
    [_citys release];
    
    [super dealloc];
}




@end
